<template>
    {{title}}--{{name}}
    <Child ref="childRef" :title="title" v-model:name="name" @changeTitle="changeTitle" />
    <button @click="change"> 主动修改</button>
</template>
<script lang="ts" setup>
import {ref,markRow,defineAsyncComponent,provide} from 'vue'
const Child = markRow(defineAsyncComponent(()=>import('./child.vue')))
const title = ref<string>('标题')
const name = ref<string>('李四')
const childRef = ref<any>(null)
provide('title1',title)
const changeTitle = (data:string)=>{
    title.value = data
}
const change = ()=>{
    childRef.value?.handleName()
}
</script>
